<%include("/common/list-top.html",
{title:"基础资料初始化",css:[
ctxPath+"/zui/dist/lib/chosen/chosen.min.css",
ctxPath+"/css/init.css",
ctxPath+"/ztree/css/metroStyle.css"]}){} %>

<div class="container-fluid">
    <div class="page-head-nav">
        <div class="row">
            <div class="col-xs-11">
                <ol class="breadcrumb">
                    <li><a href="${ctxPath}"><i class="icon icon-home"></i>工作台</a></li>
					<li>系统管理</li>
					<li><a href="${ctxPath}/init">公司数据初始化</a></li>
				</ol>
			</div>
        </div>
    </div>

<% if(CompanyType.tag){ %>
<section class="row">
		<div class="alert alert-warning-inverse with-icon">
		    <i class="icon icon-warning-sign"></i>
		    <div class="content col-xs-9">
		      <h4>谨慎使用!</h4>
		      <p>仅限模版公司使用本功能!</p>
		    </div>
		    <div class="content col-xs-3">
		    <button class="btn btn-danger  btn-lg" id="init" >确认初始化</button>
		    </div>
		</div>
		<input hidden="hidden" id="stencilCompanyId" value="${stencilCompanyId!"MB01"}">
</section> 			 
<% }else {%>
  <section class="row">
    <div class="row">
	    <div class="col-xs-12">
		    <div class="input-group">
		    	<span class="input-group-btn">
			      <button class="btn btn-info" type="button" id="helpInfo"><i class="icon icon-info-sign"></i></button>
			    </span>
		        <span class="input-group-addon">当前选中公司:</span>
		        <% if(CompanyType.type=="admin"){ %>
		        <select  id="companyId" name ="companyId" data-placeholder="---请选择公司---" class="chosen-select form-control" multiple="">
					  	<% for(company in companys){ %>
							  <option  value="${company.id!}">${company.companyName!}</option>
					  	<% } %>
				</select>
		        <% }else if(CompanyType.type=="user") { %>
		        <input value="${currentCompany.currentCompanyName}" id="companyIdText"  class="form-control" disabled="disabled">
		        <input hidden="hidden" value="${currentCompany.currentCompanyId}" id="companyId">
		        <% } %>
			    <span class="input-group-btn">
			      <button class="btn btn-danger" type="button" id="data_import"><i class="icon icon-eraser"></i> 数据导入</button>
			    </span>
			</div>
		</div>
	</div>
	<div class="row">
	 <div class="col-xs-12 hide" id="helpShow">
		 <div  class="alert alert-info-inverse with-icon" style="margin-bottom: 0"><i class="icon-info-sign"></i><div class="content"><strong>注意!</strong> 如需修改模版公司数据请联系平台方管理员。</div></div>
	 </div>
	</div>
	<div class="row">
		<div class="col-xs-12">
			<nav class="navbar navbar-default" role="navigation">
			  <ul class="nav navbar-nav nav-justified" id="nav-list">
			    <li><a href="javascript:;"  data-type="codeRule">编码规则</a></li>
			    <li><a href="javascript:;"  data-type="container" >容器模版</a></li>
			    <li><a href="javascript:;"  data-type="transport">运输方式</a></li>
			    <li><a href="javascript:;"  data-type="region">区域位置</a></li>
			    <li><a href="javascript:;"  data-type="plan">计划模版</a></li>
			  </ul>
			</nav>
		</div>
	</div>
	<div class="row " id="nav-body">
		<div class="col-xs-12 hide" id="codeRule">
		 <div class="table-responsive">
			<table class="table   table-hover">
			  <thead>
			    <tr>
			      <th ><label><input type="checkbox"> 全选</label></th>
			      <th>单据类型</th>
			      <th>规则描述</th>
			    </tr>
			  </thead>
			  <tbody>
	    	  <% for(codingRule in codingRules){ %>
	    	  <tr data-id="${codingRule.id}">
				  <td><input type="checkbox"></td>
			      <td>${codingRule.billType}</td>
			      <td>${codingRule.ruleDesc}</td>
		      </tr>
			  <% } %>
			  </tbody>
			</table>
		 </div>
		</div>
		<div class="col-xs-12 hide" id="container">
			<div class="table-responsive">
			<table class="table   table-hover">
			  <thead>
			    <tr>
			      <th><label><input type="checkbox"> 全选</label></th>
			      <th>容器名称</th>
			      <th>容器类型</th>
			      <th>长(cm)</th>
			      <th>宽(cm)</th>
			      <th>高(cm)</th>
			      <th>自重(kg)</th>
			      <th>承重(kg)</th>
			    </tr>
			  </thead>
			  <tbody>
			    <% for(containerTemplate in containerTemplates){ %>
		    	  <tr data-id="${containerTemplate.id}">
					  <td><input type="checkbox"></td>
				      <td>${containerTemplate.templateName}</td>
				      <% if(containerTemplate.templateType==0) { %>
				      <td>仓储容器</td>
				      <% }else{  %>
				      <td>运输容器</td>
				      <%  }%>
				      <td>${containerTemplate.longs}</td>
				      <td>${containerTemplate.wide}</td>
				      <td>${containerTemplate.high}</td>
				      <td>${containerTemplate.deadWeight}</td>
				      <td>${containerTemplate.bearWeight}</td>
			      </tr>
			   <% } %>
			  </tbody>
			</table>
		 </div>
		</div>
		<div class="col-xs-12 hide" id="transport">
			<div class="table-responsive">
			<table class="table   table-hover">
			  <thead>
			    <tr>
			      <th><label><input type="checkbox"> 全选</label></th>
			      <th>中文名称</th>
			      <th>英文名称</th>
			      <th>描述/说明</th>
			    </tr>
			  </thead>
			  <tbody>
			     <% for(transport in transports){ %>
		    	  <tr data-id="${transport.id}">
					  <td><input type="checkbox"></td>
				      <td>${transport.transportChineseName}</td>
				      <td>${transport.transportEnglishName}</td>
				      <td>${transport.description}</td>
			      </tr>
			     <% } %>
			  </tbody>
			</table>
		 </div>
		</div>
		<div class="col-xs-12 hide" id="region">
		<div class="row">
			<div class="col-xs-5  regis-left">
				<div class="regis-left-text" data-load="0"></div>
				<ul id="menuTree" class="ztree" style="overflow:auto;"></ul>
				<div id="regis-left-Mask"></div>
			</div>
			<div class="col-xs-2">
				<div>
					<button class="btn" type="button" id="getPostions"><p>>>>>>>>>>>></p><p>确认区域,获取位置信息。</p></button>
				</div>
				<div style="height: 100px"></div>
				<div>
					<button disabled="disabled" class="btn" type="button" id="clearPostions"><p>×××××××××××</p><p>清空位置信息,重新选取。</p></button>
				</div>
			</div>
			<div class="col-xs-5 regis-right " id="postion">
				<div class="regis-right-text">等待左侧区域数据选择</div>
				<div class="table-responsive">
				<table class="table   table-hover">
				  <thead>
				    <tr>
				      <th><label><input type="checkbox" disabled="disabled"> 全选</label></th>
				      <th>位置名称</th>
				    </tr>
				  </thead>
				  <tbody>
				  	
				  </tbody>
				</table>
				</div>
			</div>
		</div>
		</div>
		
		<div class="col-xs-12 hide" id="plan">
			<div class="table-responsive">
			<table class="table   table-hover">
			  <thead>
			    <tr>
			      <th><label><input type="checkbox"> 全选</label></th>
			      <th>计划模板名称</th>
			      <th>运输方式</th>
			      <th>起始地</th>
			      <th>目的地</th>
			      <th>描述</th>
			    </tr>
			  </thead>
			  <tbody>
			     <% for(planTemplate in planTemplates){ %>
		    	  <tr data-id="${planTemplate.id}">
					  <td><input type="checkbox"></td>
				      <td>${planTemplate.planTemplateName}</td>
				      <td>${planTemplate.transportTypeName}</td>
				      <td>${planTemplate.startPlaceName}</td>
				      <td>${planTemplate.destinationName}</td>
				      <td>${planTemplate.remarks}</td>
			      </tr>
			     <% } %>
			  </tbody>
			</table>
		 </div>
		</div>
		
	</div>
</section>  

<div class="modal fade" id="dataListShowModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
        <h4 class="modal-title">您确认要进行数据重置操作嘛？</h4>
      </div>
      <div class="modal-body">
        <p class="with-padding text-primary">将对列表选中的以下:</p>
        <div id="dataListShowInfo"></div>
		<p class="with-padding text-primary">共( <strong id="num" class="text-red">  </strong> )条数据,导入到目标公司:</p>
        <p class="with-padding text-warning" id="companyShowInfo"></p>
        <p class="with-padding text-primary">中,   <strong class="text-red">*注意:该操作等待时间随数据量增大而增大,数据量庞大时请耐心等待...</strong></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" id="dataListShowOkBtn">确定</button>
      </div>
    </div>
  </div>
</div>

<% }%>  
</div>
<%include("/common/list-bottom.html",{js:[
ctxPath+"/zui/dist/lib/chosen/chosen.min.js",
ctxPath+"/js/systemManage/init.js",
ctxPath+"/ztree/js/jquery.ztree.all.min.js"]}){}
%>
